# coding:utf-8
# author:frank
# date:2024/12/31
import pygame

pygame.init()

window = pygame.display.set_mode((400,500))

pygame.display.set_caption('基本动画')

y = 200
# 绘制一个圆形
pygame.draw.circle(window,'blue',(200,y),5)
pygame.display.flip()

# 游戏节奏计数器
count = 0
# 游戏循环
while True:
    count +=1
    if count%1000==0:
        # 将圆形涂成背景色
        pygame.draw.circle(window, 'black', (200, y), 5)
        # 修改y轴
        y += 0.5
        # 重新绘制
        pygame.draw.circle(window, 'blue', (200, y), 5)
        # 局部更新
        pygame.display.update()

    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            exit()